package com.ktjy.test;

import com.ktjy.entity.Equip;
import com.ktjy.entity.Player;
import com.ktjy.service.EquipService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 黄军艳
 * @version 1.0
 * @date 2024/12/2  13:53
 */
public class Main {
    @Test
    public void test() {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        Player player = (Player) context.getBean("zhangsan");
        Equip zhanshenRing = (Equip) context.getBean("zhanshenRing");

        player.updateEquip(zhanshenRing);
        System.out.println("装备名称："+player.getRing().getName()+"\n速度增效："+player.getRing().getSpeedPlus()
                            +"\n攻击增效："+player.getRing().getAttackPlus()+"\n防御增效："+player.getRing().getDefencePlus());
    }
}
